{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# GPyOpt: external objective function evaluation\n",
    "\n",
    "### Written by Andrei Paleyes, Amazon Research Cambridge\n",
    "\n",
    "\n",
    "*Last updated 12 October 2017*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "GPyOpt allows to evaluate objective function externally. If users opt for this approach, they can use GPyOpt to suggest next point for evaluation, and then evaluate the objective function themselves as well as decide on the stopping criteria of the evaluation loop."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Populating the interactive namespace from numpy and matplotlib\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/gojav/anaconda/lib/python3.5/site-packages/matplotlib/__init__.py:1350: UserWarning:  This call to matplotlib.use() has no effect\n",
      "because the backend has already been chosen;\n",
      "matplotlib.use() must be called *before* pylab, matplotlib.pyplot,\n",
      "or matplotlib.backends is imported for the first time.\n",
      "\n",
      "  warnings.warn(_use_error_msg)\n",
      "/Users/gojav/anaconda/lib/python3.5/site-packages/matplotlib/__init__.py:1350: UserWarning:  This call to matplotlib.use() has no effect\n",
      "because the backend has already been chosen;\n",
      "matplotlib.use() must be called *before* pylab, matplotlib.pyplot,\n",
      "or matplotlib.backends is imported for the first time.\n",
      "\n",
      "  warnings.warn(_use_error_msg)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "warning in stationary: failed to import cython module: falling back to numpy\n",
      "warning in stationary: failed to import cython module: falling back to numpy\n"
     ]
    }
   ],
   "source": [
    "%pylab inline\n",
    "import GPyOpt\n",
    "from numpy.random import seed"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For the purposes of this notebook we are going to use one of the predefined objective functions that come with GPyOpt. However the key thing to realize is that the function could be anything (e.g., the results of a physical experiment). As long as users are able to externally evaluate the suggested points somehow and provide GPyOpt with results, the library has opinions about the objective function's origin."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "func = GPyOpt.objective_examples.experiments1d.forrester() "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we define the domain of the function to optimize as usual."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "domain =[{'name': 'var1', 'type': 'continuous', 'domain': (0,1)}]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "First we are going to run the optimization loop outside of GPyOpt, and only use GPyOpt to get the next point to evaluate our function.\n",
    "\n",
    "There are two thing to pay attention to when creating the main optimization object:\n",
    "* Objective function f is explicitly set to None\n",
    "* Since we recreate the object anew for each iteration, we need to pass data about all previous iterations to it"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "X_init = np.array([[0.0],[0.5],[1.0]])\n",
    "Y_init = func.f(X_init)\n",
    "\n",
    "iter_count = 10\n",
    "current_iter = 0\n",
    "X_step = X_init\n",
    "Y_step = Y_init\n",
    "\n",
    "while current_iter < iter_count:\n",
    "    bo_step = GPyOpt.methods.BayesianOptimization(f = None, domain = domain, X = X_step, Y = Y_step)\n",
    "    x_next = bo_step.suggest_next_locations()\n",
    "    y_next = func.f(x_next)\n",
    "    \n",
    "    X_step = np.vstack((X_step, x_next))\n",
    "    Y_step = np.vstack((Y_step, y_next))\n",
    "    \n",
    "    current_iter += 1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's visualize the results. The size of the marker denotes the order in which the point was evaluated - the bigger the marker the later was the evaluation."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhE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5q8Z\nbOM3kqXX1u0pZb+XutzabfMRnu9ZGwW3Odm8nz8BlwC7kp32fDtwftnvpS63Dtr8JGDl4N+WZwH7\nAD8FflT2e6nDbfAzuxvZl44B4O2DP+80Snvncvws/Y2P0hinAU3gUbJktPuQxy4Erh+2/b5kyfdR\n4PfArLLfQ91u7bQ52boRa0a4zSn7fdTp1u7nfNhzDRJdaHOytSOuBf4+GCo+CWxc9vuo062DNn8z\n8JvBNl9Ktq7EdmW/jzrcgP0GA8SIf5uLOn560S5JktSxSs2RkCRJ9WKQkCRJHTNISJKkjhkkJElS\nxwwSkiSpYwYJSZLUMYOEJEnqmEFCkiR1zCAhSZI6ZpCQJEkdM0hIkqSO/X8SUZoLEnbPzQAAAABJ\nRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10d426fd0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "x = np.arange(0.0, 1.0, 0.01)\n",
    "y = func.f(x)\n",
    "\n",
    "plt.figure()\n",
    "plt.plot(x, y)\n",
    "for i, (xs, ys) in enumerate(zip(X_step, Y_step)):\n",
    "    plt.plot(xs, ys, 'rD', markersize=10 + 20 * (i+1)/len(X_step))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To compare the results, let's now execute the whole loop with GPyOpt."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "bo_loop = GPyOpt.methods.BayesianOptimization(f = func.f, domain = domain, X = X_init, Y = Y_init)\n",
    "bo_loop.run_optimization(max_iter=iter_count)\n",
    "X_loop = bo_loop.X\n",
    "Y_loop = bo_loop.Y"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now let's print the results of this optimization and compare to the previous external evaluation run. As before, size of the marker corresponds to its evaluation order."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "output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Hl7VNPmhNeN2NjJY7rvz5GnR7W/5x3eqyCRQpsT\nXjtiPvCftlBxIbCl78+Rp0eENv8q8M+2Nl9KeF2JAb4/Rx4ewMi2ANHp3+ak+k/dtEtEREQiy9Qa\nCREREckXBQkRERGJTEFCREREIlOQEBERkcgUJERERCQyBQkRERGJTEFCREREIlOQEBERkcgUJERE\nRCQyBQkRERGJTEFCREREIvt/VY7urrugNaMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1106a9978>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure()\n",
    "plt.plot(x, y)\n",
    "for i, (xl, yl) in enumerate(zip(X_loop, Y_loop)):\n",
    "    plt.plot(xl, yl, 'rD', markersize=10 + 20 * (i+1)/len(X_step))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To allow even more control over the execution, this API allows to specify points that should be ignored (say the objetive is known to fail in certain locations), as well as points that are already pending evaluation (say in case the user is running several candidates in parallel). Here is how one can provide this information."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.78428913]])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pending_X = np.array([[0.75]])\n",
    "ignored_X = np.array([[0.15], [0.85]])\n",
    "bo = GPyOpt.methods.BayesianOptimization(f = None, domain = domain, X = X_step, Y = Y_step, de_duplication = True)\n",
    "bo.suggest_next_locations(pending_X = pending_X, ignored_X = ignored_X)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Few things to note here:\n",
    "* It is required to set `de_duplication` flag of the optimization object to `True` to enable treatment of pending and ignored locations.\n",
    "* At the moment library treats ignored and pending the same way - does not suggest them as candidates. There are plans to leverage their semantic difference to further optimize the library's behavior."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
